<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:th="http://www.thymeleaf.org"
      xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
      xmlns:sec="http://www.thymeleaf.org/extras/spring-security">
<head>
    <meta charset="utf-8"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
    <meta name="_csrf" th:content="${_csrf.token}"/>
    <!-- default header name is X-CSRF-TOKEN -->
    <meta name="_csrf_header" th:content="${_csrf.headerName}"/>
    <title layout:title-pattern="$LAYOUT_TITLE - $CONTENT_TITLE">TodoList</title>
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport"/>
    <link rel="stylesheet" th:href="@{'/webjars/bootstrap/4.1.3/css/bootstrap.css'}">
    <link rel="stylesheet" th:href="@{'/css/styles.css'}">
</head>

<body>

<nav class="navbar navbar-expand-md navbar-dark fixed-top bg-primary">
    <a class="navbar-brand" href="#">TodoList</a>
    <button class="navbar-toggler" type="button" data-toggle="collapse"
            data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent"
            aria-expanded="false" aria-label="Toggle navigation">
        <span class="navbar-toggler-icon"></span>
    </button>

    <div class="collapse navbar-collapse" id="navbarSupportedContent">
        <ul class="navbar-nav mr-auto">
            <!--<li class="nav-item">
                <a class="nav-link" href="#">Home <span class="sr-only">(current)</span></a>
            </li>-->
        </ul>
        <ul class="navbar-nav">
            <li class="nav-item" sec:authorize="isAnonymous()">
                <a class="nav-link" href="#" th:href="@{/login}">Login</a>
            </li>
            <li class="nav-item" sec:authorize="isAuthenticated()">
                <a class="nav-link"
                   data-toggle="collapse" href="#collapseExample"
                   aria-expanded="false" aria-controls="collapseExample">Add Todo</a>
            </li>
            <li class="nav-item" sec:authorize="isAuthenticated()">
                <a class="nav-link" href="#" th:href="@{/logout}">Logout</a>
            </li>
        </ul>
    </div>
</nav>

<div id="app" class="container">
    <div layout:fragment="content">
        <!-- Your Page Content Here -->
    </div>
</div>

<footer class="footer">
    <div class="container">
        <p class="text-center">SivaLabs &copy; 2019</p>
    </div>
</footer>

<script th:src="@{'/webjars/jquery/3.0.0/jquery.js'}"></script>
<script th:src="@{'/webjars/popper.js/1.14.3/umd/popper.js'}"></script>
<script th:src="@{'/webjars/bootstrap/4.1.3/js/bootstrap.js'}"></script>
<script th:src="@{'/webjars/vue/2.5.16/vue.js'}"></script>
<div layout:fragment="pageScripts">
</div>
</body>
</html>
